package priv.happy.mealpickpro.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

import java.util.ArrayList;

/**
 * @Author: HAPPY
 * @Project_name: recruitSystem
 * @Package_name: priv.happy.mealpick.config
 * @Date:
 * @Description: Swagger3配置
 */
@Configuration
public class Swagger3Config {

    /**
     * 配置swagger的ApiInfo bean
     *
     * @return
     */
    @Bean
    public ApiInfo createApiInfo() {
        return new ApiInfo("Recruit Swagger"
                , "Recruit Api Documentation"
                , "1.0"
                , "https://gitee.com/Happy_Yang226/recruit-system"
                , new Contact("冷芝士鸭", "https://blog.csdn.net/happy488127311?spm=1000.2115.3001.5343",
                "488127311@qq.com")
                , "Apache 2.0"
                , "http://www.apache.org/licenses/LICENSE-2.0"
                , new ArrayList());
    }

    /**
     * 配置swagger的Docket bean
     *
     * @return
     */
    @Bean
    public Docket createRestApi() {
        // 指定swagger3.0版本
        return new Docket(DocumentationType.OAS_30)
                .apiInfo(createApiInfo());
    }

}

